﻿using System;

namespace Pcap.NetSample
{
    class Program
    {
        static void Main(string[] args)
        {
            //获取所有网络适配器.ObtainingTheDeviceList();
            //打印网卡设备详细信息.ObtainingAdvancedInformationAboutInstalledDevices();
            //异步抓取数据包.OpeningAnAdapterAndCapturingThePackets();
            //同步抓取数据包.CapturingThePacketsWithoutTheCallback();
            解析数据包.InterpretingThePackets();

            //转储dump文件.SavingPacketsToADumpFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ethernet.dump"));
            //读取dump文件.ReadingPacketsFromADumpFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ethernet.dump"));
            //发送单个数据包.SendingASinglePacketWithSendPacket();
            //使用缓冲区发送数据包.SendingPacketsUsingSendBuffer(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ethernet.dump"));

            //收集关于网络流量的统计信息.GatheringStatisticsOnTheNetworkTraffic();

            //string macAddress = "58-00-E3-4A-7E-4B";
            //System.Console.WriteLine($"{macAddress} -> {ARP示例.GetIpFromMac(macAddress)}");
            Console.ReadLine();
        }
    }
}
// https://www.nuget.org/packages/PcapDotNet/
// Install-Package PcapDotNet -Version 0.10.2
// https://github.com/PcapDotNet/Pcap.Net
// https://github.com/PcapDotNet/Pcap.Net/wiki/User-Guide

// https://github.com/chmorgan/packetnet
// https://www.winpcap.org/
// https://www.winpcap.org/docs/docs_412/html/group__language.html
// https://github.com/PcapDotNet/Pcap.Net/wiki/FAQ

// ARP详解 https://blog.csdn.net/lm409/article/details/80299823